move obo call to earlier#383
Conversation
* Fix nullable warnings. (#362) * fix userflow claims in addAccounToCacheFromAuthCode (#388) * make aadIssuerValidator public (#385) * Fixes Azure DevOps issue 1097354 (#387) Co-authored-by: pmaytak <34331512+pmaytak@users.noreply.github.com> Co-authored-by: jennyf19 <jeferrie@microsoft.com>
|
@jennyf19 tested the Web API incremental tutorial which is now way faster when doing OBO. This is perceivable from the UI of the client when adding a todo item it's now super fast. |
| public const string SerializingSessionCache = "Serializing session {0}, cache key {1}. "; | ||
| public const string ClearingSessionCache = "Clearing session {0}, cache key {1}. "; | ||
|
|
||
| public const string ErrorAcquiringTokenForOboForWebApi = "Error acquiring a token for obo for a web API - MsalUiRequiredException message is: {0} ."; |
There was a problem hiding this comment.
| public const string ErrorAcquiringTokenForOboForWebApi = "Error acquiring a token for obo for a web API - MsalUiRequiredException message is: {0} ."; | |
| public const string ErrorAcquiringTokenForOboForWebApi = "Error acquiring a token for On-Behalf-Of flow for a web API - MsalUiRequiredException message is: {0} ."; | |
| ``` #Resolved |
There was a problem hiding this comment.
i'm going to call it downstream web api instead, as OBO is not a flow, and it is confusing for a customer. thanks, peter. :)
In reply to: 464802916 [](ancestors = 464802916)
There was a problem hiding this comment.
Yea, downstream API makes sense.
Yea, idk I got the phrase from MS docs: https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow. :)
| try | ||
| { | ||
| // In web API, validatedToken will not be null | ||
| JwtSecurityToken? validatedToken = CurrentHttpContext.GetTokenUsedToCallWebAPI(); |
There was a problem hiding this comment.
| JwtSecurityToken? validatedToken = CurrentHttpContext.GetTokenUsedToCallWebAPI(); | |
| JwtSecurityToken? validatedToken = CurrentHttpContext?.GetTokenUsedToCallWebAPI(); | |
| ``` #Resolved |
There was a problem hiding this comment.
|
|
||
| private async Task<ClaimsPrincipal?> GetAuthenticatedUserAsync(ClaimsPrincipal? user) | ||
| { | ||
| if (user == null && _httpContextAccessor.HttpContext != null) |
There was a problem hiding this comment.
| if (user == null && _httpContextAccessor.HttpContext != null) | |
| if (user == null && _httpContextAccessor.HttpContext?.User != null) | |
| ``` #Resolved |
There was a problem hiding this comment.
#381
cc: @jmprieur
Needs a lot of manual testing: